
#include "syscall.h"

void helper1() 
{
	char* execName = "../test/triplematmult";
	int nameLen = 22;
	int i = 1;
	
	for(i = 1; i <= 1; i++)
	{
		FPrint("helper1 instance %d starting...\n", 33, 1, i);
		Exec(execName, nameLen);
		FPrint("helper1 instance %d completed\n", 31, 1, i);	
	}
	
	Exit(0);
}

void helper2()
{
	char* execName = "../test/printftest";
	int nameLen = 18;
	int i = 1;
	
	for(i = 1; i <= 4; i++)
	{
		FPrint("helper2 instance %d starting...\n", 33, 1, i);
		Exec(execName, nameLen);
		FPrint("helper2 instance %d completed\n", 31, 1, i);	
	}
	
	Exit(0);
}

void helper3()
{
	char* execName = "../test/exittest";
	int nameLen = 16;
	int i = 1;
	
	for(i = 1; i <= 4; i++)
	{
		FPrint("helper3 instance %d starting...\n", 33, 1, i);
		Exec(execName, nameLen);
		FPrint("helper3 instance %d completed\n", 31, 1, i);	
	}
	
	Exit(0);
}

int main()
{
	int i = 1;
	
	for(i = 1; i <= 3; i++)
	{
		Fork(helper1);
		Fork(helper2);
		Fork(helper3);
	}
}